﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using shop.entity;

namespace shop.web.common
{
    public partial class admin_common : System.Web.UI.MasterPage
    {
        protected User user;
        protected int userRank;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                user = (User)Session["user"];
                userRank = user.Rank;

            } else if (userRank<2) {
                //权限不够，或者未登录，直接页面重定向前台首页
                Response.Redirect("/web/view_admin/user/Login.aspx");
                //测试
                //user = new User()
                //{
                //    Name = "test"
                //};
                //userRank = 3;
            }
        }
    }
}